package com.chinaunicom.emergency.model;


import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @author liliang
 * @date 2019-12-13
 */
@Getter
@Setter
@Entity
@EqualsAndHashCode
@Table(name = "YJGL_PERMISSIONS")
@ApiModel(value="权限资源定义表（菜单、功能、业务资源、api）")
public class Permissions implements Serializable {
    @Id
    @GenericGenerator(name = "permissionsUUID", strategy = "uuid")
    @GeneratedValue(generator = "permissionsUUID")
    private String pid;
    @ApiModelProperty(value="权限标识符")
    private String permissionsCode;

    @ApiModelProperty(value="权限标识符-中文")
    private String permissionsCn;

    @ApiModelProperty(value="应用key")
    private String appkey;

    @ApiModelProperty(value="资源类型,0-菜单目录 1-菜单 2-菜单下面功能（增加按钮、删除按钮等等） 3-接入到平台的应用的资源编码（比如北信源的策略编码，其中定义了第一部分人、第二部分人） Api")
    private Integer resourceType;

    @ApiModelProperty(value="上级菜单编号,-1无上级")
    private String parentId;

    @ApiModelProperty(value="显示顺序")
    private Integer orderId;

    @ApiModelProperty(value="资源图标（完整HTTPS的资源路径）resource_type=4不用填")
    private String icon;


    @ApiModelProperty(value="资源描述")
    private String perDescribe;


    @ApiModelProperty(value="api地址（完整HTTPS的资源路径）resource_type=4必须填")
    private String url;


    @ApiModelProperty(value="Api是否需要token认证 resource_type=4必须填")
    private Integer requireToken;

    @ApiModelProperty(value="创建人")
    private String createBy;

    @ApiModelProperty(value="创建时间")
    private Date createTime;

    @ApiModelProperty(value="修改人")
    private String updateBy;

    @ApiModelProperty(value="修改时间")
    private Date updateTime;

    @ApiModelProperty(value="软删除")
    private Integer isSoftDel;

    @ApiModelProperty(value="删除人")
    private String deleteBy;

    @ApiModelProperty(value="删除时间")
    private Date deleteTime;




    @Override
    public String toString(){
        return JSONObject.toJSONString(this);
    }
}
